*************************************************************************************************
*																								*
*						Flexible Wages, Bargaining, and The Gender Gap							*
*						Barbara Biasi and Heather Sarsons										*
*						Appendix Figures														*
*																								*
*************************************************************************************************

clear all
set more off
set matsize 11000
set maxvar 32000


global user = 1 // 1 = Heather, 2 = Barbara

if $user == 1 {
cd "/Users/sarsons/Dropbox/wisconsin_women/data"
global tab = "/Users/sarsons/Dropbox/wisconsin_women/draft/tables"
global out = "/Users/sarsons/Dropbox/wisconsin_women/out"
global RA = "/Users/sarsons/Dropbox/wisconsin_women/do/calvin"
global do = "/Users/sarsons/Dropbox/wisconsin_women/do"
global data "/Users/sarsons/Dropbox/wisconsin_women/data"
}
if $user == 2 {
cd "~/Dropbox/Research/wisconsin_women/data"
global tab = "~/Dropbox/Research/wisconsin_women/draft/tables"
global out = "~/Dropbox/Research/wisconsin_women/out"
global RA = "~/Dropbox/Research/wisconsin_women/do/calvin"
global data = "~/Dropbox/Research/wisconsin_women/data"
}

* Yale colors
global yaleblue = "0 53 107"
global ylb = "40 109 192"
global yo = "189 83 25"
global ylight = "217 233 242"
global graph = "xlabel(,grid glp(dot) glc(gs10) tlc(gs10)) ylabel(,grid glp(dot) glc(gs10) tlc(gs10)) plotregion(lp(blank))"
global graphbar = "ylabel(,grid glp(dot) glc(gs10) tlc(gs10)) plotregion(lp(blank))"


global exp_c = "i.district_code##i.dataset i.district_code#i.postexp##i.dataset i.totalexp##i.dataset i.totalexp#i.postexp##i.dataset i.master##i.dataset i.master#i.postexp##i.dataset i.phd##i.dataset i.phd#i.postexp##i.dataset i.middle##i.dataset i.middle#i.postexp##i.dataset i.high##i.dataset i.high#i.postexp##i.dataset i.math##i.dataset i.math#i.postexp##i.dataset i.year##i.dataset i.year##i.expire##i.dataset"


do $do/QJE_R1/preamble_revision.do
replace logsalary = logsalary * 100
keep if timex > -6


*-----------------> Cengiz et al., stacked event studies
label var zero "0"

preserve
	keep if extension==2011|extension==2016|extension==2014
	g dataset=1
	tempfile s1
	save `s1', replace
restore	
preserve
	keep if extension==2012|extension==2016
	g dataset=2
	tempfile s2
	save `s2', replace
restore	

keep if extension==2013|extension==2016
g dataset=3

append using `s1'
append using `s2'

reghdfe logsalary femx_7-femx_9 zero femx_11-femx_13 female if timex > -4 & timex < 4, a($exp_c i.year##i.dataset i.year##i.extension##i.dataset) vce(cluster district_code)
	est store r1
coefplot (r1, lw(thick) lc("$ylb") recast(connect) ciopts(color("$ylb % 30"))), vert xline(4.5) graphreg(fc(white)) omitted xla(-4(1)4) title("Stacked (2011-2013 cohorts treated)", size(med)) ///
xtitle("time to CBA expiration/extension") ytitle("Coefficient") keep(femx_7 femx_8 femx_9 zero femx_11 femx_12 femx_13)
graph export $out/did_stacked_3.png, replace


reghdfe logsalary femx_6-femx_9 zero femx_11-femx_14 female if timex < 5 & ((dataset == 1 & extension != 2014) | dataset == 2), a($exp_c i.year##i.dataset i.year##i.extension##i.dataset) vce(cluster district_code)
	est store r1
coefplot (r1, lc("$ylb") lw(thick) recast(connect) ciopts(lc("$ylb % 30"))), vert xline(5.5) graphreg(fc(white)) omitted xla(-4(1)4) title("Stacked (2011-2012 cohorts treated)", size(med)) ///
xtitle("time to CBA expiration/extension") ytitle("Coefficient") keep(femx_5 femx_6 femx_7 femx_8 femx_9 zero femx_11 femx_12 femx_13 femx_14)
graph export $out/did_stacked_2.png, replace


